﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zocono.WCS.Domain.EquipmentProcessDomain
{
    public class ScMessageServiceFactory : IScMessageServiceFactory
    {
        private readonly IEnumerable<IScActionMessageService> _scActionMessages;

        public ScMessageServiceFactory(IEnumerable<IScActionMessageService> scActionMessages)
        {
            _scActionMessages = scActionMessages;
        }

        public IScActionMessageService CreateScActionService(string objectType)
        {
            //string serviceName = $"{objectType}Service";
            var instance = _scActionMessages.SingleOrDefault(s => s.GetType().Name == objectType);
            return instance;
        }

    }
}
